package com.example.demo.web.Controller;

import java.io.IOException;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.context.request.async.DeferredResult;

import com.example.demo.web.services.LogUionService;


@Controller
public class LogController {
	
	private LogUionService loguionService;
	
    @Autowired
    public void setLogUionService(LogUionService loguionService){
        this.loguionService = loguionService;
    }
	
	@RequestMapping(value="/getUserManagerLogs",method=RequestMethod.POST,produces="text/html;charset=UTF-8;") 
	public @ResponseBody DeferredResult<String> getUserManagerLogs(@RequestBody String objnode,HttpServletRequest req, HttpSession session) throws IOException{
		DeferredResult<String> deferredResult = new DeferredResult<String>();
    	loguionService._getUserManagerLogs(deferredResult,objnode,req,session);
    	return deferredResult;
	}
	
	@RequestMapping(value="/usersyslogquery",method=RequestMethod.POST,produces="text/html;charset=UTF-8;") 
	public @ResponseBody DeferredResult<String> usersyslogquery(@RequestBody String objnode,HttpServletRequest req, HttpSession session) throws IOException{
		DeferredResult<String> deferredResult = new DeferredResult<String>();
    	loguionService._usersyslogquery(deferredResult,objnode,req,session);
    	return deferredResult;
	}

}
